<?php

require_once APP_DIR . '/models/User.php';

class Users
{
	/**
	 * An gateway to retrieve instances of the User active record object.
	 *
	 * @var Zend_Db_ActiveRecord_Gateway
	 */
	protected $users;
	
	
	public function __construct()
	{
		$this->users = new Zend_Db_ActiveRecord_Gateway('User');
	}
	
	
	public function loadUsers() {
		$select = $this->users->select();
		return $this->users->fetchAll($select);
	}
	
	public function saveUser($user)
	{
		$user = new Users($user);
		$user->save();
		return $user;
	}
	
	public function deleteUser($userId)
	{
		$this->users->delete($userId);
	}
	
}
